package com.springbootx.mybatis.service.impl;

import com.springbootx.mybatis.config.DataSourceType;
import com.springbootx.mybatis.config.transactional.MoreTransaction;
import com.springbootx.mybatis.mapper.MasterUsersMapper;
import com.springbootx.mybatis.mapper.SalveUsersMapper;
import com.springbootx.mybatis.pojo.Users;
import com.springbootx.mybatis.service.UserService;
import com.springbootx.mybatis.service.UserSlaveService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p></p>
 *
 * @author Tony.niu (hystrix0779@yeah.net)
 **/
@Service
public class UserServiceImpl implements UserService {
    @Resource
    MasterUsersMapper masterUsersMapper;
    @Resource
    UserSlaveService userSlaveService;

    @Override
    @MoreTransaction
    public void insert() {
        Users masterUsers=new Users();
        masterUsers.setId(0);
        masterUsers.setUserName("master测试数据");
        masterUsers.setPassWord("master测试数据");
        masterUsers.setPhone("master测试数据");
        masterUsers.setEmail("master测试数据");
        masterUsersMapper.insert(masterUsers);
        update();
    }

    @Override
    public void update() {
        masterUsersMapper.update();
    }
}
